import Decimal from 'decimal.js'
import { InferAttributes, Model } from 'sequelize'

export function decimalGetter<M extends Model = Model>(model: M, field: keyof InferAttributes<M>) {
    return new Decimal(model.getDataValue(field) ?? 0)
}
